﻿using Cordyceps.Micro.AuthServer.Dimain.Models;
using Cordyceps.Micro.AuthServer.EntityFrameworkCore;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace Cordyceps.Micro.AuthServer.PostgresSql.DbMigrator.EFCore;

public class AuthMigrationsDbContext : IdentityDbContext<
    CordycepsIdentityUser,
    CordycepsIdentityRole,
    Guid,
    CordycepsIdentityUserClaim,
    CordycepsIdentityUserRole,
    CordycepsIdentityUserLogin,
    CordycepsIdentityRoleClaim,
    CordycepsIdentityUserToken>
{
    /// <summary>
    ///     构造函数
    /// </summary>
    /// <param name="options"></param>
    public AuthMigrationsDbContext(DbContextOptions<AuthMigrationsDbContext> options)
        : base(options)
    {
    }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        modelBuilder.ConfigureAuthServer();
    }
}